﻿Public Class ContentSecurityAttribute
    Inherits MysteryClassAttribute

    Public Property implementing_type As Type

    Public Overrides Sub setUp()
        If implementing_type IsNot Nothing Then
            If implementing_type.GetInterface(GetType(IContentSecurity).FullName) Is Nothing Then
                Throw New Exception(_implementing_type.FullName & " must implement " & GetType(IContentSecurity).FullName)
            End If
        End If
    End Sub

End Class


Public Interface IContentSecurity

    Function canAccess(content As IContent, user As IUser) As Boolean


End Interface

Public Class NoSecurity
    Implements IContentSecurity

    Public Function canAccess(content As IContent, user As IUser) As Boolean Implements IContentSecurity.canAccess
        Return True
    End Function
End Class
